<!--
 * @Description: 
 * @version: 
 * @Author: liurui
 * @Date: 2024-02-04 16:30:49
 * @LastEditors: 
 * @LastEditTime: 2024-02-05 13:53:13
-->
<template>
    <div>

    </div>
</template>

<script setup lang="ts">
// 实现联合类型的全排列，将联合类型转换成所有可能的全排列数组的联合类型


type Permutation<T, K = T> = 
[T] extends [never] ? [] : T extends any ? [T, ...Permutation<Exclude<K, T>>] : never


type perm = Permutation<'A' | 'B' | 'C'>; 
// ['A', 'B', 'C'] | ['A', 'C', 'B'] | ['B', 'A', 'C'] | ['B', 'C', 'A'] | ['C', 'A', 'B'] | ['C', 'B', 'A']
</script>

<style scoped>

</style>